<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head th:replace="admin::head"></head>
<title>播放资源修改 - 管理员中心 - 双辞动漫-专注二次元动漫的小站</title>
<meta name="keywords" content="播放资源修改 - 管理员中心">
<meta name="description" content="播放资源修改 - 管理员中心">
<link rel="stylesheet" type="text/css" href="css/admin_info.css">
<script type="text/javascript" src="/template/conch/asset/js/set/formValidator.js"></script>
<script type="text/javascript" src="/static/js/jquery.imageupload.js"></script>
<script type="text/javascript">
    var maccms={"path":"","mid":"6","url":"www.scdmfun.cn","wapurl":"www.cdmfun.cn","mob_status":"0"};
    var conchtpl={"surl":"/search.html","tipt":"网站公告","tipc":"这里是双辞动漫新站<br><span class='hl-text-conch'>注意事项：</span>1.老站新老站账号不通用<br>老站网址：<span class='hl-text-conch'>dm.scdmfun.cn</span><br>2.如果登录后还是提示未登录请稍等一会再刷新即可<br>动漫闲聊群：<span class='hl-text-conch'>542266218</span>","slink":"https://www.scdmfun.cn/","short":"","api":"0","tok":"","term":"long-term","ver":"3.1"}
</script>
<body id="conch-member">
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-header"></div>
<div class="conch-header">
    <div class="conch-headwrap conch-hasone conch-hasconch hl-hide-sm">
        <div class="hl-mob-nav">
            <a href="javascript:MAC.GoBack()" class="hl-pull-left left"><i class="iconfont hl-icon-jiantouzuo"></i></a>
            <a href="javascript:void(0)" class="hl-pull-right right"></a>
            <span class="hl-mob-title hl-text-site hl-lc-1">播放资源修改</span>
        </div>
    </div>
</div>
<div class="conch-content conch-member">
    <div class="conch-ctwrap">
        <div class="hl-ctwrap-item">
            <div class="container">
                <div class="hl-row-box clearfix">
                    <div class="row">
                        <div th:replace="admin::#left"></div>
                        <div id="right" class="hl-right-content hl-col-xs-12 hl-col-sm-70w hl-col-lg-9">
                            <div class="hl-cont-right">
                                <div class="hl-rb-head hl-hidden-xs clearfix">
                                    <h2 class="hl-rb-title">播放资源修改</h2>
                                </div>
                                <div class="hl-cont-tab" id="app">
                                    <div class="hl-rb-head hl-head-page clearfix">
                                        <div class="hl-rb-title hl-site-tabs hl-site-tits hl-text-site">
                                            <a :class="pname=='双辞动漫①'?'active':''" @click="changeway('双辞动漫①')">双辞动漫①</a>
                                            <a :class="pname=='双辞动漫②'?'active':''" @click="changeway('双辞动漫②')">双辞动漫②</a>
                                            <a>动漫名：</a>
                                            <input type="text" style="position: absolute;top: 68px;border: 0;background: 0 0;line-height: 50px;width: 220px;"
                                                   placeholder="请输入动漫名" v-model="name"/>
                                            <button class="hl-btn-submit hl-bg-conch" style="width: 90px;height: 43px;display: inline;position: absolute;top: 44px;right: 234px;" @click="query">查询相关集数</button>
                                            <button class="hl-btn-submit hl-bg-conch" style="width: 90px;height: 43px;display: inline;position: absolute;top: 44px;right: 127px;" @click="add">添加新集</button>
                                            <button class="hl-btn-submit hl-bg-conch" style="width: 90px;height: 43px;display: inline;position: absolute;top: 44px;right: 20px" @click="del">删除</button>
                                        </div>
                                    </div>
                                    <div class="hl-cont-list">
                                        <div class="hl-list-wrap">
                                            <form id="fm" name="fm" method="post" action="" v-if="play!=null">
                                                <p v-for="(value,key) in play"><input type="text" style="width: 20%" v-model="value.cpname" placeholder="请输入集名"/>
                                                    <input type="text" style="width: 79%" name="index"
                                                           placeholder="请输入播放地址" v-model="value.playaddress"/></p>
                                                <input type="button" id="btn_submit" class="hl-btn-submit hl-bg-conch"
                                                       value="保存" @click="commit">
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">

        $('.btn_unbind').click(function () {
            var ac = $(this).attr('ac');
            if (ac != 'email' && ac != 'phone') {
                alert('参数错误');
            }
            if (confirm('确认解除绑定吗？此操作不可恢复？')) {
                $.ajax({
                    url: "/index.php/user/unbind.html",
                    type: "post",
                    dataType: "json",
                    data: {ac: ac},
                    beforeSend: function () {
                        //开启loading
                    },
                    success: function (r) {
                        alert(r.msg);
                        if (r.code == 1) {
                            location.href = "/index.php/user/info.html";
                        }
                    },
                    complete: function () {
                        //结束loading
                    }
                });
            }
        });

        $("#btn_submit").click(function () {
            var data = $("#fm").serialize();
            $.ajax({
                url: "/index.php/user/info.html",
                type: "post",
                dataType: "json",
                data: data,
                beforeSend: function () {
                    //开启loading
                    //$(".loading_box").css("display","block");
                    $("#btn_submit").css("background", "#fd6a6a").val("loading...");
                },
                success: function (r) {
                    alert(r.msg);
                    if (r.code == 1) {
                        location.href = "/index.php/user/info.html";
                    }
                },
                complete: function () {
                    //结束loading
                    //$(".loading_box").css("display","none");
                    $("#btn_submit").css("background", "#fa4646").val("提交");
                }
            });
        });

    </script>
</div>
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-footer"></div>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.26.0/axios.min.js"></script>
<script type="text/javascript">
    let a=new Vue({
        el: "#app",
        data: {
            name:'',
            pname:'双辞动漫①',
            play: []
        },
        methods: {
            changeway(playway){
                this.pname=playway;
                this.play=[];
            },
            add(){
                var newplay={};
                newplay.ctid=this.play[0].ctid;
                newplay.pname=this.pname;
                newplay.cpname="";
                newplay.playaddress="";
                this.play.push(newplay);
            },
            del(){
                this.play.pop();
            },
            query(){
                var url="queryByCname.do";
                var params=new URLSearchParams();
                params.append("cname",this.name);
                params.append("pname",this.pname);
                axios.post(url,params).then(res=>{
                    var data=res.data;
                    if (data.code==1){
                        this.play=data.data;
                    };
                    alert(data.msg);
                })
            },
            commit(){
                if (this.play.length==0){
                    alert("请先进行资源查询");
                    return;
                }
                var url="addPlay.do";
                var params=new URLSearchParams();
                var str=JSON.stringify(this.play);
                params.append("play",str);
                params.append("pname",this.pname);
                axios.post(url,params).then(res=>{
                    var data=res.data;
                    alert(data.msg);
                });
            }
        }
    })
</script>
</body>
</html>